home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 November / Macworld (1997-11).dmg / Updaters / Planet Goodies 7.image / Serial2ISDN / Scripts ARA / US / S2ISDN for PPP 64K / S2ISDN for PPP 64K next >
Text File  |  1997-04-07  |  8KB  |  325 lines

  1. !  Serial2ISDN for PPP 64K.
  2. !
  3. !  This script is supposed to be used with the Euronis Planet-ISDN card and
  4. !  the control panel Serial2ISDN (which is used to create a virtual serial port
  5. !  for the ISDN card for ARA or PPP to use)
  6. !
  7. !  Jean Christophe ISTIN & Frédéric ISRAEL for SAGEM/SAT France
  8. !  Version : 1.0.5
  9. !  Date    : March 25, 1997
  10. !
  11. !  'mlts' resource info for this adapter:
  12. !    byte 1 == 00 -> modem has NO built-in reliability protocols
  13. !    byte 2 == 00 -> reserved by Apple
  14. !    byte 3 == 1E -> max hex chars in varstr 7 (30 dec)
  15. !    byte 4 == 00 -> max hex chars in varstr 8
  16. !    byte 5 == 00 -> max hex chars in varstr 9
  17. !
  18. !•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  19. ! Set up Serial2ISDN - label range is 1-10
  20. !•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  21. @ORIGINATE
  22. @ANSWER
  23. !
  24. ! ========== LABEL 1 & 2 -------------------------------------------------------
  25. !
  26. @LABEL 1
  27. note "Serial2ISDN for PPP 64K." 2
  28. pause 10
  29. settries 0
  30. ! ---------- control if Serial2ISDN is openned
  31. @LABEL 2
  32. flush
  33. matchclr
  34. matchstr 1 3 "OK"
  35. !
  36. write "AT\13"
  37. matchread 30
  38. !
  39. inctries
  40. iftries 2 71
  41. lbreak
  42. jump 2
  43. !
  44. ! ---------- control version of Serial2ISDN
  45. @LABEL 3
  46. flush
  47. matchclr
  48. matchstr 1 4 "Version 1.1"
  49. !
  50. write "AT*VERS\13"
  51. matchread 30
  52. !
  53. jump 100
  54. !
  55. ! ---------- PPP Parameter
  56. @LABEL 4
  57. flush
  58. matchclr
  59. matchstr 1 9 "OK"
  60. !
  61. write "AT*PPP64K\13"
  62. matchread 200
  63. !
  64. jump 100
  65. !
  66. ! ========== LABEL 8 -----------------------------------------------------------
  67. ! Initialisation de Serial2ISDN
  68. !
  69. ! NMP10 requested       (parm 4 == 2) jump to 9
  70. ! V41 link requested    (parm 4 == 1) jump to 9
  71. ! No V41 link requested (parm 4 == 0) jump to 9
  72. !
  73. @LABEL 8
  74. !
  75. ifstr 4 9 "2"
  76. ifstr 4 9 "1"
  77. ifstr 4 9 "0"
  78. jump 76
  79. !
  80. ! ========== LABEL 9 -----------------------------------------------------------
  81. ! Fin de la portion de script commune au mode ORIGINATE & ANSWER
  82. !
  83. @LABEL 9
  84. !
  85. note "Serial2ISDN for PPP 64K initialized." 2
  86. pause 10
  87. !
  88. ifANSWER 62
  89. !
  90. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  91. ! ORIGINATE mode. - Dialing
  92. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  93. ! Dial type dispatch
  94. !
  95. ! This card has a 31 chars command buffer for dialing but cannot dial several
  96. ! strings in a row to form long dial strings. So no break up will take place here.
  97. !
  98. ! Parameter 1 contains the full dialstring from the connection document.
  99. ! Parameter 3 contains "P" for pulse & "T" for tone dialing.
  100. ! Parameter 7, 8 & 9 normally contain the dial string fragments.
  101. ! Since break up cannot be used, the parm 1 will be used for dialing
  102. !
  103. ! Normal dialing (parm 6 == 0) jump to 19
  104. ! Blind  dialing (parm 6 == 1) jump to 19
  105. ! Manual dialing (parm 6 == 2) jump to 19 
  106. !
  107. ifstr 6 19 "0"
  108. ifstr 6 19 "1"
  109. ifstr 6 19 "2"
  110. jump 76
  111. !
  112. ! ========== LABEL 19 ----------------------------------------------------------
  113. ! Normal dialing
  114. !
  115. @label 19
  116. !
  117. note "Calling : ^1" 3
  118. write "ATD^1\13"
  119. jump 32
  120. !
  121. !
  122. !•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  123. !    Connecting - label range is 31-60
  124. !•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  125. ! ========== LABEL 32 ----------------------------------------------------------
  126. !
  127. @LABEL 32
  128. !
  129. matchclr
  130. !
  131. matchstr 1  55 "CONNECT"
  132. matchstr 2  68 "RING\13\10"
  133. !
  134. matchstr 3  73 "NO CARRIER\13\10"
  135. matchstr 4  73 "ERROR\13\10"
  136. matchstr 5  80 "TIME OUT\13\10"
  137. !
  138. matchread 600
  139. !
  140. ! If in ANSWER mode, loop back.
  141. ! Else in ORIGINATE mode, the modem has timed out.
  142. !
  143. ifANSWER 32
  144. jump 71
  145. !
  146. ! ========== LABEL 55 ----------------------------------------------------------
  147. ! Connection established
  148. !
  149. @LABEL 55
  150. !
  151. USERHOOK 1
  152. CommunicatingAt 64000
  153. !
  154. ! -- Modem error correction link negotiation --
  155. ! Userhook 2 informs ARA that a modem-to-modem error
  156. ! correcting protocol has been negotiated
  157. !
  158. ! USERHOOK 2
  159. !
  160. ! -- Compression negotiation --
  161. ! Userhook 3 informs ARA that a modem-to-modem compression
  162. ! protocol has been negotiated
  163. !
  164. ! USERHOOK 3
  165. !
  166. ! -- Modem error correction link negotiation --
  167. ! Userhook 4 informs ARA that a modem-to-modem error
  168. ! correcting NM10 protocol has been negotiated
  169. !
  170. ! USERHOOK 4
  171. !
  172. note "Connection established..." 2
  173. pause 50
  174. exit 0
  175. !
  176. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  177. ! Here is ANSWER mode initialization part - label range is 61-70
  178. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  179. ! ========== LABEL 62 ----------------------------------------------------------
  180. ! Set the adapter to answer on 1st ring
  181. !
  182. @LABEL 62
  183. !
  184. note "Waiting for call..." 2
  185. pause 10
  186. !
  187. matchclr
  188. matchstr 1 32 "OK"
  189. write "ATS0=1\13"
  190. matchread 30
  191. jump 71
  192. !
  193. ! ========== LABEL 68 ----------------------------------------------------------
  194. ! RING entry point
  195. ! If ORIGINATE mode return to waiting for input.
  196. ! Else claim the serial port and return.
  197. @LABEL 68
  198. !
  199. ifORIGINATE 32
  200. userhook 1
  201. note "Answering..." 2
  202. jump 32
  203. !
  204. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  205. ! Error messages - label range is 71-100
  206. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  207. ! ========== LABEL 71 ----------------------------------------------------------
  208. ! Modem Not Responding
  209. !
  210. @LABEL 71
  211. exit -6019
  212. ! ========== LABEL 72 ----------------------------------------------------------
  213. ! No Dialtone
  214. !
  215. @LABEL 72
  216. exit -6020
  217. ! ========== LABEL 73 ----------------------------------------------------------
  218. ! No Carrier or Error
  219. !
  220. @LABEL 73
  221. exit -6021
  222. ! ========== LABEL 74 ----------------------------------------------------------
  223. ! Busy
  224. !
  225. @LABEL 74
  226. exit -6022
  227. ! ========== LABEL 75 ----------------------------------------------------------
  228. ! No Answer
  229. !
  230. @LABEL 75
  231. exit -6023
  232. ! ========== LABEL 76 ----------------------------------------------------------
  233. ! Invalid Varstring Value
  234. !
  235. @LABEL 76
  236. exit -6027
  237. ! ========== LABEL 77 ----------------------------------------------------------
  238. ! Delayed Number (blacklisted)
  239. !
  240. @LABEL 77
  241. exit -6002 "Delayed Number."
  242. ! ========== LABEL 78 ----------------------------------------------------------
  243. ! Number forbidden (blacklisted)
  244. !
  245. @LABEL 78
  246. exit -6002 "Number forbidden. Initialize the card to reuse this number."
  247. ! ========== LABEL 79 ----------------------------------------------------------
  248. ! Blacklist full
  249. @LABEL 79
  250. exit -6002 "Blacklist full. Initialize the card."
  251. ! ========== LABEL 80 ----------------------------------------------------------
  252. ! Time Out
  253. @LABEL 80
  254. exit -6002 "No response. Time Out elapsed."
  255. ! ========== LABEL 100 ---------------------------------------------------------
  256. ! Serial2ISDN incompatible
  257. !
  258. @LABEL 100
  259. exit -6002 "Version of Serial2ISDN incompatible."
  260. !
  261. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  262. ! Hang up the adapter - label range is 101-120
  263. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  264. @HANGUP
  265. ! ========== LABEL 101 ---------------------------------------------------------
  266. !
  267. @LABEL 101
  268. !
  269. flush
  270. settries 0
  271. HSReset 0 0 0 0 0 0
  272. !
  273. ! ========== LABEL 102 ---------------------------------------------------------
  274. ! Drop the adapter into command mode with escape sequence.
  275. ! Then tell adapter to hangup.
  276. ! Repeat hangup command and escape sequence 3 times max.
  277. !
  278. @LABEL 102
  279. !
  280. flush
  281. matchclr
  282. matchstr 1 103 "OK\13\10"
  283. pause 10
  284. write "+++"
  285. pause 10
  286. matchread 50
  287. !
  288. ! ========== LABEL 103 ---------------------------------------------------------
  289. ! Pause between data and command mode
  290. !
  291. @LABEL 103
  292. !
  293. pause 20
  294. flush
  295. settries 0
  296. !
  297. ! ========== LABEL 104 ---------------------------------------------------------
  298. !
  299. @LABEL 104
  300. !
  301. matchclr
  302. matchstr 1 120 "OK"
  303. write "ATH\13"
  304. flush
  305. matchread 200
  306. inctries
  307. iftries 3 71
  308. jump 104
  309. !
  310. ! ========== LABEL 120 ---------------------------------------------------------
  311. !
  312. @LABEL 120
  313. !
  314. exit 0
  315. !
  316. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  317. ! Labels 121-128 are reserved for future emergency hacks.
  318. ! ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  319.